#pragma once
#include<iostream>
using namespace std;
class Date
{
public:
	Date(int year, int month, int day)
	{
		_year = year;
		_month = month;
		_day = day;
	}
	int GetMonthDay(int year,int month)
	{
		int monthDayArray[13] = { 0,31,28,31,30,31,30,31,31,30,31,30,31 };
		if (month == 2 && ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)))
		{
			return 29;
		}
		else
			return monthDayArray[month];
	}
	Date& operator+=(int day);
	Date operator+(int day);
	Date& operator-=(int day);
	Date operator-(int day);

	// ++d1 ->d1.operator++()
	Date& operator++();
	// d1++ ->d1.operator++(1);
	Date operator++(int);

	Date& operator--();
	Date operator--(int);

	bool operator<(const Date& d);
	bool operator<=(const Date& d);
	bool operator>(const Date& d);
	bool operator>=(const Date& d);
	bool operator==(const Date& d);
	bool operator!=(const Date& d);

	
	int operator-(const Date& d);

	void Print();
private:
	int _year;
	int _month;
	int _day;
};
